import pandas as pd

filename = "AQI.csv"

df = pd.read_csv(f"data/{filename}")
data = {"time": [f"{i}" for i in range(1, 25)]}

for i in range(21):
    l = df.values.tolist()
    if not i == 18:
        data[l[i][0]] = l[i][3:] + l[i+1][1:3]
    else:
        data[l[i][0]] = l[i][3:] + [None, None]
    pass

df_after = pd.DataFrame(data)

df_after.to_csv(f"{filename}", sep=",", index=False)